package com.example.demo.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.example.demo.mapper.PersonMapper;
import com.example.demo.pojo.Person;
import com.example.demo.service.PersonService;

@Service
public class PersonServiceImpl implements PersonService {
	
	@Autowired
	private PersonMapper personMapper = null;
	
	@Override
	public void savePerson(Person person) {
		// TODO Auto-generated method stub
		personMapper.savePerson(person);
	}

	@Override
	public Person queryPerson(int id) {
		// TODO Auto-generated method stub
		Person person = personMapper.queryPerson(id);
		return person;
	}

	@Override
	public void modifyPerson(Person person) {
		// TODO Auto-generated method stub
		personMapper.modifyPerson(person);
	}

	@Override
	public void removePerson(int id) {
		// TODO Auto-generated method stub
		personMapper.removePerson(id);
	}

	@Override
	public List<Person> queryAllPerson() {
		// TODO Auto-generated method stub
		List<Person> persons = personMapper.queryAllPerson();
		return persons;
	}

}
